<?php 
/*
  $Program: ECJC Online Shop
  $Id: subscription_prefferances.php
  $Based on: osCommerce, Open Source E-Commerce Solutions
  Released under the GNU General Public License
  language issues exist
*/
  defined( 'JOSCOM_VERSION' ) or die( 'Direct Access to this location is not allowed.' );
  if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' )
  | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_banners' ))) {
    //j15nc
  }
  if (defined( '_OSCOMMERCE_LOADED' )) {
    if (!DB_SHARED) {
      tep_db_connect() or die('Unable to connect to database server!');
    }
    global $category_links, $languages_id, $cPath, $cPath_array, $current_category_id;
    global $request_type, $lng, $cart, $currencies, $language, $navigation, $breadcrumb;
  } else {
    require(DIR_WS_COMPONENT . 'includes/application_top.php');
  }

if($_POST['make_it_so']){


$sql_data_array = array('warning' => tep_db_prepare_input($_POST['warning']), 
                        'notice1_days' => tep_db_prepare_input($_POST['notice1_days']),
                        'notice1_notice' => tep_db_prepare_input($_POST['notice1_notice']),
                        'notice2_days' => tep_db_prepare_input($_POST['notice2_days']),
                        'notice2_notice' => tep_db_prepare_input($_POST['notice2_notice']));

 tep_db_perform(TABLE_SUBSCRIPTION_CONFIG, $sql_data_array, 'update', 'go=1');
}
$info_find = tep_db_query("select * from " . TABLE_SUBSCRIPTION_CONFIG . "");
$info = tep_db_fetch_array($info_find);

?>

<link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_COMPONENT ?>includes/stylesheet.css">
<script language="javascript" src="<?php echo DIR_WS_COMPONENT ?>includes/general.js"></script>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top">
<table width=100%><tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '8'); ?></td>
      </tr>
      <tr><?php echo tep_draw_form('sub_config', tep_href_link(FILENAME_SUBSCRIPTION_PREFFERANCES, 'make_it_so=now'), 'post', 'enctype="multipart/form-data"'); ?>
      <td><table>
      <tr><td class="main">Days bills are sent out before due</td><td><? echo tep_draw_input_field('warning', $info['warning']); ?></td></tr>
      <tr><td class="main">Days untill first late notice</td><td><? echo tep_draw_input_field('notice1_days', $info['notice1_days']); ?></td></tr>
      <tr><td class="main">First late notice message</td><td><? echo tep_draw_textarea_field('notice1_notice', 'soft', '70', '15',$info['notice1_notice']); ?></td></tr>
      <tr><td class="main">Days untill termination and notice</td><td><? echo tep_draw_input_field('notice2_days', $info['notice2_days']); ?></td></tr>
      <tr><td class="main">Termination notice message</td><td><? echo tep_draw_textarea_field('notice2_notice', 'soft', '70', '15',$info['notice2_notice']); ?></td></tr>
      <tr><td class="main"></td><td><? echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td></tr></form></table>

</td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>